3.1.90 \(\int \frac {1}{\sqrt {\sin (x)} \sqrt {a-a \sin (x)}} \, dx\) [90]

Optimal. Leaf size=42 \[ \frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (x)}{\sqrt {2} \sqrt {\sin (x)} \sqrt {a-a \sin (x)}}\right )}{\sqrt {a}} \]

[Out]

arctanh(1/2*cos(x)*a^(1/2)*2^(1/2)/sin(x)^(1/2)/(a-a*sin(x))^(1/2))*2^(1/2)/a^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2861, 214} \begin {gather*} \frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (x)}{\sqrt {2} \sqrt {\sin (x)} \sqrt {a-a \sin (x)}}\right )}{\sqrt {a}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[1/(Sqrt[Sin[x]]*Sqrt[a - a*Sin[x]]),x]

[Out]

(Sqrt[2]*ArcTanh[(Sqrt[a]*Cos[x])/(Sqrt[2]*Sqrt[Sin[x]]*Sqrt[a - a*Sin[x]])])/Sqrt[a]

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 2861

Int[1/(Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*Sqrt[(c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]]), x_Symbol] :> D
ist[-2*(a/f), Subst[Int[1/(2*b^2 - (a*c - b*d)*x^2), x], x, b*(Cos[e + f*x]/(Sqrt[a + b*Sin[e + f*x]]*Sqrt[c +
 d*Sin[e + f*x]]))], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 -
 d^2, 0]

Rubi steps

\begin {align*} \int \frac {1}{\sqrt {\sin (x)} \sqrt {a-a \sin (x)}} \, dx &=-\left ((2 a) \text {Subst}\left (\int \frac {1}{2 a^2-a x^2} \, dx,x,-\frac {a \cos (x)}{\sqrt {\sin (x)} \sqrt {a-a \sin (x)}}\right )\right )\\ &=\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (x)}{\sqrt {2} \sqrt {\sin (x)} \sqrt {a-a \sin (x)}}\right )}{\sqrt {a}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
time = 0.07, size = 128, normalized size = 3.05 \begin {gather*} \frac {2 \left (F\left (\left .\sin ^{-1}\left (\frac {1}{\sqrt {\tan \left (\frac {x}{4}\right )}}\right )\right |-1\right )-\Pi \left (-1-\sqrt {2};\left .\sin ^{-1}\left (\frac {1}{\sqrt {\tan \left (\frac {x}{4}\right )}}\right )\right |-1\right )-\Pi \left (-1+\sqrt {2};\left .\sin ^{-1}\left (\frac {1}{\sqrt {\tan \left (\frac {x}{4}\right )}}\right )\right |-1\right )\right ) \sec ^2\left (\frac {x}{4}\right ) \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right ) \sqrt {\sin (x)}}{\sqrt {1-\cot ^2\left (\frac {x}{4}\right )} \sqrt {a-a \sin (x)} \tan ^{\frac {3}{2}}\left (\frac {x}{4}\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[1/(Sqrt[Sin[x]]*Sqrt[a - a*Sin[x]]),x]

[Out]

(2*(EllipticF[ArcSin[1/Sqrt[Tan[x/4]]], -1] - EllipticPi[-1 - Sqrt[2], ArcSin[1/Sqrt[Tan[x/4]]], -1] - Ellipti
cPi[-1 + Sqrt[2], ArcSin[1/Sqrt[Tan[x/4]]], -1])*Sec[x/4]^2*(Cos[x/2] - Sin[x/2])*Sqrt[Sin[x]])/(Sqrt[1 - Cot[
x/4]^2]*Sqrt[a - a*Sin[x]]*Tan[x/4]^(3/2))

________________________________________________________________________________________

Maple [A]
time = 0.33, size = 53, normalized size = 1.26

method result size
default \(-\frac {2 \sqrt {-\frac {-1+\cos \left (x \right )}{\sin \left (x \right )}}\, \left (-1+\cos \left (x \right )+\sin \left (x \right )\right ) \left (\sqrt {\sin }\left (x \right )\right ) \arctanh \left (\sqrt {-\frac {-1+\cos \left (x \right )}{\sin \left (x \right )}}\right )}{\sqrt {-a \left (-1+\sin \left (x \right )\right )}\, \left (-1+\cos \left (x \right )\right )}\) \(53\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/sin(x)^(1/2)/(a-a*sin(x))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-2*(-(-1+cos(x))/sin(x))^(1/2)*(-1+cos(x)+sin(x))*sin(x)^(1/2)*arctanh((-(-1+cos(x))/sin(x))^(1/2))/(-a*(-1+si
n(x)))^(1/2)/(-1+cos(x))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/sin(x)^(1/2)/(a-a*sin(x))^(1/2),x, algorithm="maxima")

[Out]

integrate(1/(sqrt(-a*sin(x) + a)*sqrt(sin(x))), x)

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 168, normalized size = 4.00 \begin {gather*} \left [\frac {\sqrt {2} \log \left (\frac {17 \, \cos \left (x\right )^{3} + 3 \, \cos \left (x\right )^{2} + \frac {4 \, \sqrt {2} {\left (3 \, \cos \left (x\right )^{2} - {\left (3 \, \cos \left (x\right ) + 4\right )} \sin \left (x\right ) - \cos \left (x\right ) - 4\right )} \sqrt {-a \sin \left (x\right ) + a} \sqrt {\sin \left (x\right )}}{\sqrt {a}} - {\left (17 \, \cos \left (x\right )^{2} + 14 \, \cos \left (x\right ) - 4\right )} \sin \left (x\right ) - 18 \, \cos \left (x\right ) - 4}{\cos \left (x\right )^{3} + 3 \, \cos \left (x\right )^{2} - {\left (\cos \left (x\right )^{2} - 2 \, \cos \left (x\right ) - 4\right )} \sin \left (x\right ) - 2 \, \cos \left (x\right ) - 4}\right )}{4 \, \sqrt {a}}, -\frac {1}{2} \, \sqrt {2} \sqrt {-\frac {1}{a}} \arctan \left (\frac {\sqrt {2} \sqrt {-a \sin \left (x\right ) + a} \sqrt {-\frac {1}{a}} {\left (3 \, \sin \left (x\right ) + 1\right )}}{4 \, \cos \left (x\right ) \sqrt {\sin \left (x\right )}}\right )\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/sin(x)^(1/2)/(a-a*sin(x))^(1/2),x, algorithm="fricas")

[Out]

[1/4*sqrt(2)*log((17*cos(x)^3 + 3*cos(x)^2 + 4*sqrt(2)*(3*cos(x)^2 - (3*cos(x) + 4)*sin(x) - cos(x) - 4)*sqrt(
-a*sin(x) + a)*sqrt(sin(x))/sqrt(a) - (17*cos(x)^2 + 14*cos(x) - 4)*sin(x) - 18*cos(x) - 4)/(cos(x)^3 + 3*cos(
x)^2 - (cos(x)^2 - 2*cos(x) - 4)*sin(x) - 2*cos(x) - 4))/sqrt(a), -1/2*sqrt(2)*sqrt(-1/a)*arctan(1/4*sqrt(2)*s
qrt(-a*sin(x) + a)*sqrt(-1/a)*(3*sin(x) + 1)/(cos(x)*sqrt(sin(x))))]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\sqrt {- a \left (\sin {\left (x \right )} - 1\right )} \sqrt {\sin {\left (x \right )}}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/sin(x)**(1/2)/(a-a*sin(x))**(1/2),x)

[Out]

Integral(1/(sqrt(-a*(sin(x) - 1))*sqrt(sin(x))), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 149 vs. \(2 (31) = 62\).
time = 1.45, size = 149, normalized size = 3.55 \begin {gather*} \frac {\sqrt {2} {\left (\log \left (\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} - \sqrt {\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{4} - 6 \, \tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} + 1} + 1\right ) - \log \left ({\left | -\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} + \sqrt {\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{4} - 6 \, \tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} + 1} + 3 \right |}\right ) - \log \left ({\left | -\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} + \sqrt {\tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{4} - 6 \, \tan \left (-\frac {1}{8} \, \pi + \frac {1}{4} \, x\right )^{2} + 1} + 1 \right |}\right )\right )}}{2 \, \sqrt {a} \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, x\right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/sin(x)^(1/2)/(a-a*sin(x))^(1/2),x, algorithm="giac")

[Out]

1/2*sqrt(2)*(log(tan(-1/8*pi + 1/4*x)^2 - sqrt(tan(-1/8*pi + 1/4*x)^4 - 6*tan(-1/8*pi + 1/4*x)^2 + 1) + 1) - l
og(abs(-tan(-1/8*pi + 1/4*x)^2 + sqrt(tan(-1/8*pi + 1/4*x)^4 - 6*tan(-1/8*pi + 1/4*x)^2 + 1) + 3)) - log(abs(-
tan(-1/8*pi + 1/4*x)^2 + sqrt(tan(-1/8*pi + 1/4*x)^4 - 6*tan(-1/8*pi + 1/4*x)^2 + 1) + 1)))/(sqrt(a)*sgn(sin(-
1/4*pi + 1/2*x)))

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {1}{\sqrt {\sin \left (x\right )}\,\sqrt {a-a\,\sin \left (x\right )}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(x)^(1/2)*(a - a*sin(x))^(1/2)),x)

[Out]

int(1/(sin(x)^(1/2)*(a - a*sin(x))^(1/2)), x)

________________________________________________________________________________________